<?php if(!defined("QG_PATH")){die("Direct file access not allowed");}
class QG_line extends QuickGraph {
	public function __construct ($width,$height)
	{
		parent::__construct($width,$height);
	}
	protected function draw ()
	{
		$this->draw_axis();
		foreach ( $this->data as $id => $data )
		{
			$last = false;
			//echo count($this->scales['x']); //-1-$this->chart_style);
			$ticks = $this->scales['xwidth']/(count($this->scales['x'])-1-$this->chart_style);
			foreach ( $data['data'] as $i => $value )
			{
				$co = $this->co($ticks*$i,$this->y_point($value),"bl");
				if ( $last === false )
				{
					$last = array($co[0],$co[1]);
				}
				else
				{
					$this->line($last[0],$last[1],$co[0],$co[1],$data['color'],$data['width']);
					$last = array($co[0],$co[1]);
				}
			}
		}
	}
}

		/*$this->line($this->width/2,0,$this->width/2,$this->height,array(255,0,0),1);
		$this->line(0,$this->height/2,$this->width,$this->height/2,array(0,255,0),1);*/
?>